import request from '@/utils/request'

// 查询草稿文章列表
export function listDraft(query) {
  return request({
    url: '/article/draft/list',
    method: 'get',
    params: query
  })
}

// 查询草稿文章详细
export function getDraft(articleId) {
  return request({
    url: '/article/draft/' + articleId,
    method: 'get'
  })
}

// 新增草稿文章
export function addDraft(data) {
  return request({
    url: '/article/draft',
    method: 'post',
    data: data
  })
}

// 修改草稿文章
export function updateDraft(data) {
  return request({
    url: '/article/draft',
    method: 'put',
    data: data
  })
}

// 删除草稿文章
export function delDraft(articleId) {
  return request({
    url: '/article/draft/' + articleId,
    method: 'delete'
  })
}

// 导出草稿文章
export function exportDraft(query) {
  return request({
    url: '/article/draft/export',
    method: 'post',
    params: query
  })
}
// 发布草稿文章
export function publishDraft(articleId) {
  return request({
    url: '/article/draft/publish/' + articleId,
    method: 'post'
  })
}
